package com.pearadmin.edu.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 角色类型
 */
@Getter
@AllArgsConstructor
public enum UserRoleEnum {
    admin(0,"管理员"),
    teacher(1,"教员"),
    student(2,"学员");
    private int code;
    private String name;
    public static String nameOfType(int type) {
        for (UserRoleEnum userTypeEnum : UserRoleEnum.values()) {
            if (userTypeEnum.getCode() == type) {
                return userTypeEnum.getName();
            }
        }
        return "";
    }
}
